import instance from '@/utils/request'
import Qs from 'qs'
/**
 * 分页查询
 */
export const menuPage = (entity) => {
  return instance.get('/sysmenu/page?' + Qs.stringify(entity))
}

/**
 * 根据 no 查询 对象
 */
export const menugetById = (no) => {
  return instance.get('/sysmenu/getById?' + Qs.stringify(no))
}

/**
 * 新增
 */
export const menuSave = (entity) => {
  return instance.post('/sysmenu/save', Qs.stringify(entity))
}

/**
 * 修改
 */
export const menuUpdateById = (entity) => {
  return instance.post('/sysmenu/updateById', Qs.stringify(entity))
}

/**
 * 批量删除
 */
export const menuBatchDelete = (nos) => {
  return instance.get('/sysmenu/deletes?nos=' + nos)
}

/**
 * 根据no删除
 */
export const menuRemoveById = (no) => {
  return instance.get('/sysmenu/removeById?no=' + no)
}

/**
 * 根据 no 修改 状态
 */
export const updateEnableByNo = (no, enable) => {
  return instance.get(`/sysmenu/updateEnableByNo?no=${no}&enable=${enable}`)
}

/**
 *获取功能管理 菜单树
 */
export const getSysMenuListTree = () => {
  return instance.get(`/sysmenu/getSysMenuListTree`)
}

/**
 *获取功能管理 菜单、功能树
 */
export const getSysMenuListTreeAll = () => {
  return instance.get(`/sysmenu/getSysMenuListTreeAll`)
}
